package com.ruoyi.wms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wms.mapper.WmsCarrierMapper;
import com.ruoyi.wms.domain.WmsCarrier;
import com.ruoyi.wms.service.IWmsCarrierService;

/**
 * 承运商Service业务层处理
 *
 * @author zmm
 * @date 2023-01-30
 */
@Service
public class WmsCarrierServiceImpl implements IWmsCarrierService
{
    @Autowired
    private WmsCarrierMapper wmsCarrierMapper;

    /**
     * 查询承运商
     *
     * @param id 承运商主键
     * @return 承运商
     */
    @Override
    public WmsCarrier selectWmsCarrierById(Long id)
    {
        return wmsCarrierMapper.selectWmsCarrierById(id);
    }

    /**
     * 查询承运商列表
     *
     * @param wmsCarrier 承运商
     * @return 承运商
     */
    @Override
    public List<WmsCarrier> selectWmsCarrierList(WmsCarrier wmsCarrier)
    {
        return wmsCarrierMapper.selectWmsCarrierList(wmsCarrier);
    }

    /**
     * 新增承运商
     *
     * @param wmsCarrier 承运商
     * @return 结果
     */
    @Override
    public int insertWmsCarrier(WmsCarrier wmsCarrier)
    {
        wmsCarrier.setCreateTime(DateUtils.getNowDate());
        return wmsCarrierMapper.insertWmsCarrier(wmsCarrier);
    }

    /**
     * 修改承运商
     *
     * @param wmsCarrier 承运商
     * @return 结果
     */
    @Override
    public int updateWmsCarrier(WmsCarrier wmsCarrier)
    {
        wmsCarrier.setUpdateTime(DateUtils.getNowDate());
        return wmsCarrierMapper.updateWmsCarrier(wmsCarrier);
    }

    /**
     * 批量删除承运商
     *
     * @param ids 需要删除的承运商主键
     * @return 结果
     */
    @Override
    public int deleteWmsCarrierByIds(Long[] ids)
    {
        return wmsCarrierMapper.deleteWmsCarrierByIds(ids);
    }

    /**
     * 删除承运商信息
     *
     * @param id 承运商主键
     * @return 结果
     */
    @Override
    public int deleteWmsCarrierById(Long id)
    {
        return wmsCarrierMapper.deleteWmsCarrierById(id);
    }
}
